import { CourseEnum } from "src/enums/school/course.enum";
import { WeekEnum } from "src/enums/school/week.enum";
import { Class } from "src/school/class/entities/class.entity";
import { Column, Entity, OneToOne, PrimaryGeneratedColumn } from "typeorm";

@Entity()
export class Course {
  //自增列
  @PrimaryGeneratedColumn()
  id: string;

  @Column({ comment: "班级id" })
  classId: number;

  @Column({ comment: "年份和周数" })
  yearWeek: string;

  @Column({ type: "json", nullable: true })
  details: { index: number; course: `${CourseEnum}`; week: keyof typeof WeekEnum }[];

  @OneToOne(() => Class)
  class: Class;
}
